﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Text;
using System.Xml.Serialization;

namespace MiniTwitter
{
    public static class Serializer<T>
    {
        private static readonly XmlSerializer xs = new XmlSerializer(typeof(T));

        public static T Deserialize(Stream stream)
        {
            return (T)xs.Deserialize(stream);
        }

        public static void Serialize(Stream stream, T o)
        {
            xs.Serialize(stream, o);
        }
    }
}